package com.fount4j.generator.context;

import com.fount4j.generator.config.DaoConfig;
import com.fount4j.generator.config.EntityConfig;
import com.fount4j.generator.config.MapperConfig;
import com.fount4j.generator.config.TableConfig;
import com.fount4j.generator.info.DaoInfo;
import com.fount4j.generator.info.EntityInfo;
import com.fount4j.generator.info.MapperInfo;
import com.fount4j.generator.info.TableInfo;
import com.fount4j.generator.introspect.BaseIntrospector;
import com.fount4j.generator.jdbc.ConnectionFactory;
import com.fount4j.generator.introspect.ColumnIntrospector;
import com.fount4j.generator.introspect.Introspector;
import org.beetl.core.Template;

import java.util.List;
import java.util.Map;

/**
 * 生成器上下文
 *
 * @author Morven 2016/12/22
 */
public class GeneratorContext {
    /** 数据库连接工厂类 */
    protected ConnectionFactory connectionFactory;
    /** 实体类模板 */
    protected Template entityTemplate;
    /** Dao 类模板 */
    protected Template daoTemplate;
    /** 映射文件模板 */
    protected Template mapperTemplate;
    /** 解析器 */
    protected Introspector introspector;
    /** 要生成的数据库表名 */
    protected List<TableConfig> tables;
    /** 实体类配置 */
    protected EntityConfig entityConfig;
    /** Dao 类配置 */
    protected DaoConfig daoConfig;
    /** 映射文件配置 */
    protected MapperConfig mapperConfig;
    /** 其他配置项 */
    protected Map<String, Object> properties;
    /** 表配置信息 */
    protected TableConfig tableConfig;
    /** 表结构信息 */
    protected TableInfo tableInfo;
    /** 实体类信息 */
    protected EntityInfo entityInfo;
    /** Dao 类信息 */
    protected DaoInfo daoInfo;
    /** 映射文件信息 */
    protected MapperInfo mapperInfo;
    /** 列解析器 */
    protected ColumnIntrospector columnIntrospector;
    /** 实体类解析器 */
    protected BaseIntrospector entityIntrospector;
    /** Dao 类解析器 */
    protected BaseIntrospector daoIntrospector;
    /** 映射文件解析器 */
    protected BaseIntrospector mapperIntrospector;

    public ConnectionFactory getConnectionFactory() {
        return connectionFactory;
    }

    public void setConnectionFactory(ConnectionFactory connectionFactory) {
        this.connectionFactory = connectionFactory;
    }

    public Template getEntityTemplate() {
        return entityTemplate;
    }

    public void setEntityTemplate(Template entityTemplate) {
        this.entityTemplate = entityTemplate;
    }

    public Template getDaoTemplate() {
        return daoTemplate;
    }

    public void setDaoTemplate(Template daoTemplate) {
        this.daoTemplate = daoTemplate;
    }

    public Template getMapperTemplate() {
        return mapperTemplate;
    }

    public void setMapperTemplate(Template mapperTemplate) {
        this.mapperTemplate = mapperTemplate;
    }

    public Introspector getIntrospector() {
        return introspector;
    }

    public void setIntrospector(Introspector introspector) {
        this.introspector = introspector;
    }

    public List<TableConfig> getTables() {
        return tables;
    }

    public void setTables(List<TableConfig> tables) {
        this.tables = tables;
    }

    public EntityConfig getEntityConfig() {
        return entityConfig;
    }

    public void setEntityConfig(EntityConfig entityConfig) {
        this.entityConfig = entityConfig;
    }

    public DaoConfig getDaoConfig() {
        return daoConfig;
    }

    public void setDaoConfig(DaoConfig daoConfig) {
        this.daoConfig = daoConfig;
    }

    public MapperConfig getMapperConfig() {
        return mapperConfig;
    }

    public void setMapperConfig(MapperConfig mapperConfig) {
        this.mapperConfig = mapperConfig;
    }

    public Map<String, Object> getProperties() {
        return properties;
    }

    public void setProperties(Map<String, Object> properties) {
        this.properties = properties;
    }

    public TableInfo getTableInfo() {
        return tableInfo;
    }

    public void setTableInfo(TableInfo tableInfo) {
        this.tableInfo = tableInfo;
    }

    public EntityInfo getEntityInfo() {
        return entityInfo;
    }

    public void setEntityInfo(EntityInfo entityInfo) {
        this.entityInfo = entityInfo;
    }

    public DaoInfo getDaoInfo() {
        return daoInfo;
    }

    public void setDaoInfo(DaoInfo daoInfo) {
        this.daoInfo = daoInfo;
    }

    public ColumnIntrospector getColumnIntrospector() {
        return columnIntrospector;
    }

    public void setColumnIntrospector(ColumnIntrospector columnIntrospector) {
        this.columnIntrospector = columnIntrospector;
    }

    public BaseIntrospector getEntityIntrospector() {
        return entityIntrospector;
    }

    public void setEntityIntrospector(BaseIntrospector entityIntrospector) {
        this.entityIntrospector = entityIntrospector;
    }

    public BaseIntrospector getDaoIntrospector() {
        return daoIntrospector;
    }

    public void setDaoIntrospector(BaseIntrospector daoIntrospector) {
        this.daoIntrospector = daoIntrospector;
    }

    public MapperInfo getMapperInfo() {
        return mapperInfo;
    }

    public void setMapperInfo(MapperInfo mapperInfo) {
        this.mapperInfo = mapperInfo;
    }

    public BaseIntrospector getMapperIntrospector() {
        return mapperIntrospector;
    }

    public void setMapperIntrospector(BaseIntrospector mapperIntrospector) {
        this.mapperIntrospector = mapperIntrospector;
    }

    public TableConfig getTableConfig() {
        return tableConfig;
    }

    public void setTableConfig(TableConfig tableConfig) {
        this.tableConfig = tableConfig;
    }
}
